* Introduced a new system for localisation caching. The system is based around fast...
[lhc/web/wiklou.git] / includes / Hooks.php
index a05f732..faf7fb9 100644 (file)
@@ -32,15 +32,16 @@ function wfRunHooks($event, $args = array()) {
 
        global $wgHooks;
 
+       // Return quickly in the most common case
+       if ( !isset( $wgHooks[$event] ) ) {
+               return true;
+       }
+
        if (!is_array($wgHooks)) {
                throw new MWException("Global hooks array is not an array!\n");
                return false;
        }
 
-       if (!array_key_exists($event, $wgHooks)) {
-               return true;
-       }
-
        if (!is_array($wgHooks[$event])) {
                throw new MWException("Hooks array for event '$event' is not an array!\n");
                return false;